/*
 * @Author: 飞越疯人院 353362604@qq.com
 * @Date: 2022-10-13 08:30:36
 * @LastEditors: error: git config user.name && git config user.email & please set dead value or install git
 * @LastEditTime: 2023-01-12 13:48:13
 * @FilePath: \adminstration\src\Common\Modal\TwoModalList\Organization.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import { API_LIST } from '../../Api/Api'
import { commonTableList } from '../config'
import { TwoAddBtn, ThrDeleteBtn } from '../options'

export const ProjectSetUpOperation = async ({ upDataEvent, data }) => {
    let dataList = {
        type: '项目运营期付费情况列表',
        hideInSearch: true,
        pageSize: 10,
        params: {},
        classification: 'TableModal',
        get: API_LIST()['getProjectOperationPayment'],
        additional: { key: 'organizationUuid', value: 'uuid' },
        options: [
            <TwoAddBtn
                upDataEvent={upDataEvent}
                title="添加"
                ThrKey="ThrModal"
                value="ProjectSetUpOperation"
                data={data}
            />,
        ],
        columns: [
            { ...commonTableList.tableName, title: '名称' },
            {
                dataIndex: 'yearMonth',
                title: '年月',
                valueType: 'Date',
                picker: 'month',
                rules: true,
                width: 150,
            },
            {
                dataIndex: 'loanPrincipalCopeAmount',
                title: '贷款本金应付金额',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                dataIndex: 'loanPrincipalPaidAmount',
                title: '贷款本金已付金额',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                dataIndex: 'loanInterestCopeAmount',
                title: '贷款利息应付金额',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                dataIndex: 'loanInterestPaidAmount',
                title: '贷款利息已付金额',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                dataIndex: 'capitalPrincipalCopeAmount',
                title: '资本金本金应付金额',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                dataIndex: 'capitalPrincipalPaidAmount',
                title: '资本金本金已付金额',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                dataIndex: 'capitalInterestCopeAmount',
                title: '资本金收益应付金额',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                dataIndex: 'capitalInterestPaidAmount',
                title: '资本金收益已付金额',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                dataIndex: 'operationFeeCopeAmount',
                title: '运营养护费应付金额',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                dataIndex: 'operationFeePaidAmount',
                title: '运营养护费已付金额',
                valueType: 'inputNumber',
                rules: true,
                width: 200,
            },
            {
                title: '操作',
                valueType: 'systemOperation',
                fixed: 'right',
                width: 220,
                hideInSearch: true,
                hideInAdded: true,
                hideInModify: true,
                render: (_, record) => {
                    return [
                        <ThrDeleteBtn
                            key="delete"
                            record={record.uuid}
                            upDataEvent={upDataEvent}
                            data={{ key: 'delete', url: 'delProjectOperationPayment', title: '删除' }}
                        />,
                    ]
                },
            },
        ],
    }
    return dataList
}
